﻿using System;
using Microsoft.VisualStudio.TestTools.UnitTesting;
using Cdx.Common;
using System.Drawing;

namespace Test.Cdx.Common
{
    [TestClass]
    public class Functionality
    {
        [TestMethod]
        public void BasicFlow()
        {
            var serviceAuthenctication = ServicesFactory.AuthenticationService;
            var userId = serviceAuthenctication.Authenticate("test1", "123456");
            Assert.IsNotNull(userId);

            var serviceDocumentsManager = ServicesFactory.DocumentManagerService;
            var documentID = serviceDocumentsManager.AddDocument(userId, LoadDocument());

            var serviceClassification = ServicesFactory.ClassificationService;
            var classID = serviceClassification.Classify(serviceDocumentsManager.GetDocument(documentID));
            var dataRegionList =  serviceClassification.GetDataRegions(classID);

            var serviceRecognition = ServicesFactory.RecognitionService;
            var data = serviceRecognition.Recognize(serviceDocumentsManager.GetDocument(documentID), dataRegionList);

            var serviceEngine = ServicesFactory.EngineService;
            var file = serviceEngine.CalculateOutput(data);
        }

        private string LoadDocument()
        {
            throw new NotImplementedException();
        }
    }
}
